package com.yq.reggie.controller;

import lombok.Data;

import java.io.Serializable;

/**
 * 通用返回结果
 */
@Data
public class Result  implements Serializable {
    private Integer code;
    private Object data;
    private String msg;

    public static Result success(Object data){
        Result result = new Result();
        result.setCode(1);
        result.setMsg("");
        result.setData(data);
        return  result;
    }
    public static Result fail(String message){
        Result result = new Result();
        result.setCode(0);
        result.setData("");
        result.setMsg(message);
        return result;
    }
}
